/**
*	流程模块： 菜单管理menu的扩展js
*	开发者：雨中磐石
*	地址：www.rockoa.com
*	日期：2023-07-20
*/



js.menu_list = function(){
	
	var me = this;
	var pidss = '0';
	
	this.initbodys = function(){
		this.settable({
			fanye:false,
			sort:'sort',dir:'asc',
			urlparams:{pid:'0'}
		});
		this.optobj.showleft('菜单');
		
	}
	
	this.onloadbefore = function(d){
		if(d.menuarr){
			importjs('tree','create', {
				data:[{id:0,pid:'0',name:'顶级',stotal:0}].concat(d.menuarr),
				view:this.optobj.leftcontid(),
				onitemclick:function(d){
					me.openpid(d.id);
				}
			});
		}
	}
	
	this.openpid = function(pid){
		pidss = pid;
		this.table.setparams({pid:pid}, true);
	}
	
	this.onaddbefore = function(){
		return {
			data:{'pid':pidss}
		};
	}
}